package utils.eutilsUtil.http;

import org.apache.http.message.BasicNameValuePair;

/**
 * @Author: gcr
 * @Date: 2022-6-1 18:00
 */
public class Eutils {

    public static String getPmXml(String s) {

        HttpClientConfig config = new HttpClientConfig()
                .setUrl("https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi")
                .build();
        config.getNvpsList().add(new BasicNameValuePair("db", "pubmed"));
        config.getNvpsList().add(new BasicNameValuePair("retmode", "xml"));
        config.getNvpsList().add(new BasicNameValuePair("id", s));
        String body = HttpClientUtil.post(config);
        return body;
    }

}
